package com.chen.app.util;

import com.google.code.kaptcha.Producer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.awt.image.BufferedImage;

@Service("sysCaptchaService")
public class SysCaptchaService {

    @Autowired
    private Producer producer;

    public BufferedImage getCaptcha() {
        //生成文字验证码
        String code = producer.createText();
        return producer.createImage(code);
    }

}
